<div id="content" class="hfeed">
    <div class="page hentry entry">
        <div class="post-wrap">
            <div class="entry-content">

                <h2>Xem thông tin</h2>
                <dl>
                		<dt><?php echo __('Purchase Id'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['purchase_id']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Purchase Code'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['purchase_code']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Vendor'); ?></dt>
                		<dd>
                			<?php echo $this->Html->link($purchase['Vendor']['vendor_name'], array('controller' => 'vendors', 'action' => 'view', $purchase['Vendor']['vendor_id'])); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Employee'); ?></dt>
                		<dd>
                			<?php echo $this->Html->link($purchase['Employee']['employee_name'], array('controller' => 'employees', 'action' => 'view', $purchase['Employee']['employee_id'])); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Date Purchase'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['date_purchase']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Subtotal'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['subtotal']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Discount For Buyer'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['discount_for_buyer']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Total'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['total']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Dept'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['dept']); ?>
                			&nbsp;
                		</dd>
                		<dt><?php echo __('Purchase Description'); ?></dt>
                		<dd>
                			<?php echo h($purchase['Purchase']['purchase_description']); ?>
                			&nbsp;
                		</dd>
                	</dl>

                <div class="related">
                	<h3><?php echo __('Related Purchase Details'); ?></h3>
                	<?php if (!empty($purchase['PurchaseDetail'])): ?>
                	<table cellpadding = "0" cellspacing = "0">
                	<tr>
                		<th><?php echo __('Purchase Detail Id'); ?></th>
                		<th><?php echo __('Purchase Id'); ?></th>
                		<th><?php echo __('Mobile Model Id'); ?></th>
                		<th><?php echo __('Quantity'); ?></th>
                		<th><?php echo __('Price'); ?></th>
                		<th><?php echo __('Total'); ?></th>
                		<th class="actions"><?php echo __('Actions'); ?></th>
                	</tr>
                	<?php foreach ($purchase['PurchaseDetail'] as $purchaseDetail): ?>
                		<tr>
                			<td><?php echo $purchaseDetail['purchase_detail_id']; ?></td>
                			<td><?php echo $purchaseDetail['purchase_id']; ?></td>
                			<td><?php echo $purchaseDetail['mobile_model_id']; ?></td>
                			<td><?php echo $purchaseDetail['quantity']; ?></td>
                			<td><?php echo $purchaseDetail['price']; ?></td>
                			<td><?php echo $purchaseDetail['total']; ?></td>
                			<td class="actions">
                				<?php echo $this->Html->link(__('View'), array('controller' => 'purchase_details', 'action' => 'view', $purchaseDetail['purchase_detail_id'])); ?>
                				<?php echo $this->Html->link(__('Edit'), array('controller' => 'purchase_details', 'action' => 'edit', $purchaseDetail['purchase_detail_id'])); ?>
                				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'purchase_details', 'action' => 'delete', $purchaseDetail['purchase_detail_id']), array(), __('Are you sure you want to delete # %s?', $purchaseDetail['purchase_detail_id'])); ?>
                			</td>
                		</tr>
                	<?php endforeach; ?>
                	</table>
                <?php endif; ?>

                	<div class="actions">
                		<ul>
                			<li><?php echo $this->Html->link(__('New Purchase Detail'), array('controller' => 'purchase_details', 'action' => 'add')); ?> </li>
                		</ul>
                	</div>
                </div>

            </div>
        </div>
    </div>
</div>
<div id="sidebar" class="sidebar">
    <div class="widget">
        <h4>Chức năng</h4>
        <ul class="menu">
            <li><?php echo $this->Html->link(__('Edit Purchase'), array('action' => 'edit', $purchase['Purchase']['purchase_id'])); ?> </li>
            		<li><?php echo $this->Form->postLink(__('Delete Purchase'), array('action' => 'delete', $purchase['Purchase']['purchase_id']), array(), __('Are you sure you want to delete # %s?', $purchase['Purchase']['purchase_id'])); ?> </li>
            		<li><?php echo $this->Html->link(__('List Purchases'), array('action' => 'index')); ?> </li>
            		<li><?php echo $this->Html->link(__('New Purchase'), array('action' => 'add')); ?> </li>
        </ul>
    </div>
</div>




<div class="purchases view">
<h2><?php echo __('Purchase'); ?></h2>
	<dl>
		<dt><?php echo __('Purchase Id'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['purchase_id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Purchase Code'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['purchase_code']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Vendor'); ?></dt>
		<dd>
			<?php echo $this->Html->link($purchase['Vendor']['vendor_name'], array('controller' => 'vendors', 'action' => 'view', $purchase['Vendor']['vendor_id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Employee'); ?></dt>
		<dd>
			<?php echo $this->Html->link($purchase['Employee']['employee_name'], array('controller' => 'employees', 'action' => 'view', $purchase['Employee']['employee_id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Date Purchase'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['date_purchase']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Subtotal'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['subtotal']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Discount For Buyer'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['discount_for_buyer']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Total'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['total']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Dept'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['dept']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Purchase Description'); ?></dt>
		<dd>
			<?php echo h($purchase['Purchase']['purchase_description']); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Purchase'), array('action' => 'edit', $purchase['Purchase']['purchase_id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Purchase'), array('action' => 'delete', $purchase['Purchase']['purchase_id']), array(), __('Are you sure you want to delete # %s?', $purchase['Purchase']['purchase_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Purchases'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Purchase'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Vendors'), array('controller' => 'vendors', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Vendor'), array('controller' => 'vendors', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Employees'), array('controller' => 'employees', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Employee'), array('controller' => 'employees', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Purchase Details'), array('controller' => 'purchase_details', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Purchase Detail'), array('controller' => 'purchase_details', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Purchase Details'); ?></h3>
	<?php if (!empty($purchase['PurchaseDetail'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Purchase Detail Id'); ?></th>
		<th><?php echo __('Purchase Id'); ?></th>
		<th><?php echo __('Mobile Model Id'); ?></th>
		<th><?php echo __('Quantity'); ?></th>
		<th><?php echo __('Price'); ?></th>
		<th><?php echo __('Total'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($purchase['PurchaseDetail'] as $purchaseDetail): ?>
		<tr>
			<td><?php echo $purchaseDetail['purchase_detail_id']; ?></td>
			<td><?php echo $purchaseDetail['purchase_id']; ?></td>
			<td><?php echo $purchaseDetail['mobile_model_id']; ?></td>
			<td><?php echo $purchaseDetail['quantity']; ?></td>
			<td><?php echo $purchaseDetail['price']; ?></td>
			<td><?php echo $purchaseDetail['total']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'purchase_details', 'action' => 'view', $purchaseDetail['purchase_detail_id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'purchase_details', 'action' => 'edit', $purchaseDetail['purchase_detail_id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'purchase_details', 'action' => 'delete', $purchaseDetail['purchase_detail_id']), array(), __('Are you sure you want to delete # %s?', $purchaseDetail['purchase_detail_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Purchase Detail'), array('controller' => 'purchase_details', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
